<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:mo="https://gitee.com/aun/NGou">
<head th:replace="/common/template :: header(~{::title},~{::link},~{::style})">
</head>
<body class="timo-layout-page">
<div class="layui-card">
    <div class="layui-card-header timo-card-header">
        <span><i class="fa fa-bars"></i> 客户管理</span>
        <i class="layui-icon layui-icon-refresh refresh-btn"></i>
    </div>
    <div class="layui-card-body">
        <div class="layui-row timo-card-screen">
            <div class="pull-left layui-form-pane timo-search-box">
                <div class="layui-inline">
                    <label class="layui-form-label">客户名称</label>
                    <div class="layui-input-block">
                        <input type="text" name="name" th:value="${param.name}" placeholder="客户名称"
                               autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">客户标签</label>
                    <div class="layui-input-block timo-search-status">
                        <select class="timo-search-select" name="tag" mo-empty="全部" mo:dict="CUSTTAG"
                                mo-selected="${param.tag} "></select>
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">客户状态</label>
                    <div class="layui-input-block timo-search-status">
                        <select class="timo-search-select" name="state" mo-empty="全部" mo:dict="CUSTSTATE"
                                mo-selected="${param.state} "></select>
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">重要程度</label>
                    <div class="layui-input-block timo-search-status">
                        <select class="timo-search-select" name="importanceLevel" mo-empty="全部" mo:dict="CUSTIMPOT"
                                mo-selected="${param.importanceLevel} "></select>
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">负责人</label>
                    <div class="layui-input-block">
                        <input type="text" name="userName" th:value="${param.userName}" placeholder="负责人"
                               autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">联系人</label>
                    <div class="layui-input-block">
                        <input type="text" name="contact" th:value="${param.contact}" placeholder="联系人"
                               autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <button class="layui-btn timo-search-btn">
                        <i class="fa fa-search"></i>
                    </button>
                </div>
            </div>
            <div class="pull-right screen-btn-group">
                <button class="layui-btn open-popup" data-title="添加客户管理"
                        th:attr="data-url=@{/market/customer/add}" data-size="max">
                    <i class="fa fa-plus"></i> 添加
                </button>
                <div class="btn-group">
                    <button class="layui-btn">操作<span class="caret"></span></button>
                    <dl class="layui-nav-child layui-anim layui-anim-upbit">
                        <dd><a class="ajax-status" th:href="@{/market/customer/status/ok}">启用</a></dd>
                        <dd><a class="ajax-status" th:href="@{/market/customer/status/freezed}">冻结</a></dd>
                        <dd><a class="ajax-status" th:href="@{/market/customer/status/delete}">删除</a></dd>
                    </dl>
                </div>
            </div>
        </div>
        <div class="timo-table-wrap">
            <table class="layui-table timo-table">
                <thead>
                <tr>
                    <th class="timo-table-checkbox">
                        <label class="timo-checkbox"><input type="checkbox">
                            <i class="layui-icon layui-icon-ok"></i></label>
                    </th>
                    <th>操作</th>
                    <th>客户名称</th>
                    <th>客户来源</th>
                    <th>客户标签</th>
                    <th>客户状态</th>
                    <th>重要程度</th>
                    <th>所属行业</th>
                    <th>负责人</th>
                    <th>联系人</th>
                    <th>创建日期</th>
                    <th>更新日期</th>

                </tr>
                </thead>
                <tbody>
                <tr th:each="item:${list}">
                    <td><label class="timo-checkbox"><input type="checkbox" th:value="${item.id}">
                        <i class="layui-icon layui-icon-ok"></i></label></td>
                    <td>
                        <a class="open-popup" data-title="编辑客户管理"
                           th:attr="data-url=@{'/market/customer/edit/'+${item.id}}" data-size="max" href="#">编辑</a>
                        <a class="ajax-get" data-msg="您是否确认删除"
                           th:href="@{/market/customer/status/delete(ids=${item.id})}">删除</a>
                    </td>
                    <td><a class="open-popup" data-title="详细信息"
                           th:attr="data-url=@{'/market/customer/detail/'+${item.id}}" data-size="800,600" href="#">[[${item.name}]]</a>
                    </td>
                    <td th:text="${#dicts.keyValue('CUSTSOURCE',item.source)}">客户来源</td>
                    <td th:text="${#dicts.keyValue('CUSTTAG',item.tag)}">客户标签</td>
                    <td th:text="${#dicts.keyValue('CUSTSTATE',item.state)}">客户状态</td>
                    <td th:text="${#dicts.keyValue('CUSTIMPOT',item.importanceLevel)}">重要程度</td>
                    <td th:text="${#dicts.keyValue('INDUSTRY',item.industry)}">所属行业</td>
                    <td th:text="${item.userName}">负责人</td>
                    <td th:text="${item.contact}">联系人</td>
                    <td th:text="${#dates.format(item.createDate, 'yyyy-MM-dd')}">创建时间</td>
                    <td th:text="${#dates.format(item.updateDate, 'yyyy-MM-dd')}">更新时间</td>

                </tr>
                </tbody>
            </table>
        </div>
        <div th:replace="/common/fragment :: page"></div>
    </div>
</div>
<script th:replace="/common/template :: script"></script>
</body>
</html>